/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ylystudio.pms.ejb.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Kenny Lin
 */
@Entity
@Table(name = "meeting_summary")
@NamedQueries({
    @NamedQuery(name = "MeetingSummary.findAll", query = "SELECT m FROM MeetingSummary m"),
    @NamedQuery(name = "MeetingSummary.findByMsId", query = "SELECT m FROM MeetingSummary m WHERE m.msId = :msId"),
    @NamedQuery(name = "MeetingSummary.findByMsContent", query = "SELECT m FROM MeetingSummary m WHERE m.msContent = :msContent"),
    @NamedQuery(name = "MeetingSummary.findByMsSide", query = "SELECT m FROM MeetingSummary m WHERE m.msSide = :msSide"),
    @NamedQuery(name = "MeetingSummary.findByMsDate", query = "SELECT m FROM MeetingSummary m WHERE m.msDate = :msDate"),
    @NamedQuery(name = "MeetingSummary.findByMsRemark", query = "SELECT m FROM MeetingSummary m WHERE m.msRemark = :msRemark")})
public class MeetingSummary implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ms_id")
    private Integer msId;
    @Basic(optional = false)
    @Column(name = "ms_content")
    private String msContent;
    @Basic(optional = false)
    @Column(name = "ms_side")
    private String msSide;
    @Basic(optional = false)
    @Column(name = "ms_date")
    @Temporal(TemporalType.DATE)
    private Date msDate;
    @Column(name = "ms_remark")
    private String msRemark;
    @JoinColumn(name = "meet_id", referencedColumnName = "meet_id")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Meeting meeting;

    public MeetingSummary() {
    }

    public MeetingSummary(Integer msId) {
        this.msId = msId;
    }

    public MeetingSummary(Integer msId, String msContent, String msSide, Date msDate) {
        this.msId = msId;
        this.msContent = msContent;
        this.msSide = msSide;
        this.msDate = msDate;
    }

    public Integer getMsId() {
        return msId;
    }

    public void setMsId(Integer msId) {
        this.msId = msId;
    }

    public String getMsContent() {
        return msContent;
    }

    public void setMsContent(String msContent) {
        this.msContent = msContent;
    }

    public String getMsSide() {
        return msSide;
    }

    public void setMsSide(String msSide) {
        this.msSide = msSide;
    }

    public Date getMsDate() {
        return msDate;
    }

    public void setMsDate(Date msDate) {
        this.msDate = msDate;
    }

    public String getMsRemark() {
        return msRemark;
    }

    public void setMsRemark(String msRemark) {
        this.msRemark = msRemark;
    }

    public Meeting getMeeting() {
        return meeting;
    }

    public void setMeeting(Meeting meeting) {
        this.meeting = meeting;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (msId != null ? msId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MeetingSummary)) {
            return false;
        }
        MeetingSummary other = (MeetingSummary) object;
        if ((this.msId == null && other.msId != null) || (this.msId != null && !this.msId.equals(other.msId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ylystudio.pms.ejb.entity.MeetingSummary[msId=" + msId + "]";
    }

}
